﻿using OccurrencesCore.Model;
using OccurrencesCore.Service;
using OccurrencesWorkflow.BaseControl.Base;
using OccurrencesWorkflow.BaseControl.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Transactions;

namespace OccurrencesWorkflow.SpecializedControl.ScheduledReturn.Tasks
{
    public class CompetenceApprovalTaskControl : BaseTask
    {
        public CompetenceApprovalTaskControl(int taskId)
            : base(taskId)
        {

        }

        public void Approve()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                base.Approve();
                scope.Complete();
            }
        }

        public void Reject()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                base.Reject();
                scope.Complete();
            }
        }


        public void Cancel()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                base.Cancel();
                scope.Complete();
            }
        }
    }
}
